package com.headingdata.branch;

public class IfDemo1 {
    public static void main(String[] args) {
        //学习if用法及执行流程
        //需求1：测量用户体温，大于37度就报警
        double template = 38.5;
        if(template > 37){
            System.out.println("体温异常，请注意！");
        }

        //需求2：发红包，余额99，发出90，钱够就发红包，不够就提示：余额不足
        double balance = 85;
        if(balance >= 90){
            System.out.println("红发发送成功！");
        }else {
            System.out.println("余额不足！");
        }

        //需求3：公司绩效[0,60) D [60,80) C [80,90) B [90,100] A
        double score = 100;
        if (score >= 0 && score < 60){
            System.out.println("您的绩效级别是:D");
        } else if (score >= 60 && score < 80) {
            System.out.println("您的绩效级别是:C");
        }else if (score >= 80 && score < 90) {
            System.out.println("您的绩效级别是:B");
        }else if (score >= 90 && score <= 100) {
            System.out.println("您的绩效级别是:A");
        }else{
            System.out.println("您输入的分数有误！");
        }
    }
}
